﻿package com.wandian.controller
{  
	import com.wandian.data.GameData;
	import com.wandian.model.PrizeProxy;
	import com.wandian.model.UserInfoProxy;
	import com.wandian.view.mediator.PrizeMediator;
	
	import flash.display.MovieClip;
	
	import org.puremvc.as3.interfaces.INotification;
	import org.puremvc.as3.patterns.command.SimpleCommand;

    public class PrizeCommand extends SimpleCommand
    {
        private var _global:GameData;
        private var _mcPanel:MovieClip;

        public function PrizeCommand()
        {
            this._global = GameData.getInstance();
            return;
        }

        override public function execute(notification:INotification) : void
        {
			trace("[PrizeCommand,break]"+notification.getName());
			return;
            var _loc_3:Array = null;
            super.execute(notification);
            var _loc_2:* = facade.retrieveProxy(PrizeProxy.NAME) as PrizeProxy;
            switch(notification.getName())
            {
                case CLZNoticeName.SHOW_PRIZE_PANEL:
                {
                    this.showPanel();
                    break;
                }
                case CLZNoticeName.PRIZE_MY_REWARD_REQ:
                {
                    _loc_2.requestMyPrize();
                    break;
                }
                case CLZNoticeName.PRIZE_RANK_REWARD_REQ:
                {
                    _loc_2.requestRankPrize(notification.getBody() as int);
                    break;
                }
                case CLZNoticeName.PRIZE_ACC_REWARD_REQ:
                {
                    _loc_3 = notification.getBody() as Array;
                    _loc_2.requestAccPrize(_loc_3[0], _loc_3[1]);
                    break;
                }
                case CLZNoticeName.PRIZE_TOP_REWARD_REQ:
                {
                    _loc_3 = notification.getBody() as Array;
                    _loc_2.requestTopPrize(_loc_3[0], _loc_3[1]);
                    break;
                }
                case CLZNoticeName.PRIZE_LOGIN_REWARD_REQ:
                {
                    _loc_2.requestLoginPrize(notification.getBody() as int);
                    break;
                }
                case CLZNoticeName.PRIZE_VIP_REWARD_REQ:
                {
                    _loc_2.requestVIPPrize();
                    break;
                }
                case CLZNoticeName.PRIZE_WINNUM_REWARD_REQ:
                {
                    _loc_2.requestWinNumPrize(notification.getBody() as int);
                    break;
                }
                case CLZNoticeName.PRIZE_BAG_REWARD_REQ:
                {
                    _loc_2.requestBagPrize(notification.getBody() as int);
                    break;
                }
                case CLZNoticeName.SGJ_ZP_REQ:
                {
                    _loc_2.requestSGJ_ZP_Prize(notification.getBody() as int);
                    break;
                }
                case CLZNoticeName.SGJ_ZP_RANK_REQ:
                {
                    _loc_2.requestSGJ_ZP_Rank(notification.getBody() as int);
                    break;
                }
                case CLZNoticeName.INIT_PAY_BAG_REQ:
                {
                    _loc_2.requestInitPayBag();
                    break;
                }
                case CLZNoticeName.DRAW_PAY_BAG_REQ:
                {
                    _loc_2.requestDrawPayBag(notification.getBody() as int);
                    break;
                }
                case CLZNoticeName.WEIBO_REQ:
                {
                    _loc_2.requestWeibo(1);
                    break;
                }
                case CLZNoticeName.RED_REQ:
                {
                    _loc_2.requestRed(notification.getBody() as String);
                    break;
                }
                case CLZNoticeName.NATIONAL_DAY_REQ:
                {
                    _loc_2.requestNational();
                    break;
                }
                case CLZNoticeName.NATIONAL_DAY_DRAW_REQ:
                {
                    _loc_2.requestDrawNational(notification.getBody() as int);
                    break;
                }
                default:
                {
                    break;
                }
            }
            return;
        }

        private function showPanel() : void
        {
            if (!this._mcPanel)
            {
                this._mcPanel = GameData.getMovieClip("PrizePanel");
            }
            if (!Texas.I._mcWindosView.contains(this._mcPanel))
            {
                Texas.I._mcWindosView.addChildTo(this._mcPanel);
                Texas.I._mcWindosView.centerXY(this._mcPanel);
            }
            facade.registerMediator(new PrizeMediator(this._mcPanel));
            return;
        }

    }
}
